FROM openjdk:17-jdk-slim

LABEL maintainer="korean-learning"
LABEL description="Korean Learning Application Backend"

# 工作目录
WORKDIR /app

# 复制Maven文件
COPY pom.xml .
COPY .mvn .mvn
COPY mvnw .

# 下载依赖
RUN ./mvnw dependency:go-offline -B

# 复制源代码
COPY src src

# 构建应用
RUN ./mvnw clean package -DskipTests

# 暴露端口
EXPOSE 8080

# 启动应用
CMD ["java", "-jar", "target/korean-learning-1.0.0.jar"] 